<%@ Control Language="C#" AutoEventWireup="true" Inherits="NopSolutions.NopCommerce.Web.Administration.Modules.ProductPicturesControl"
    CodeBehind="ProductPictures.ascx.cs" %>
<%@ Register TagPrefix="nopCommerce" TagName="NumericTextBox" Src="NumericTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="SimpleTextBox" Src="SimpleTextBox.ascx" %>
<%@ Register TagPrefix="nopCommerce" TagName="ToolTipLabel" Src="ToolTipLabelControl.ascx" %>
<asp:GridView ID="gvwImages" runat="server" AutoGenerateColumns="false" DataKeyNames="ProductPictureID"
    OnRowDeleting="gvwImages_RowDeleting" OnRowDataBound="gvwImages_RowDataBound"
    OnRowCommand="gvwImages_RowCommand" Width="100%">
    <Columns>
        <asp:TemplateField HeaderText="Image" ItemStyle-Width="50%">
            <ItemTemplate>
                <asp:Image ID="iProductPicture" runat="server" />
                <asp:HiddenField ID="hfProductPictureID" runat="server" Value='<%# Eval("ProductPictureID") %>' />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Display order" HeaderStyle-HorizontalAlign="Center"
            ItemStyle-Width="15%" ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" Width="50px" ID="txtProductPictureDisplayOrder"
                    Value='<%# Eval("DisplayOrder") %>' RequiredErrorMessage="Display order is required"
                    RangeErrorMessage="The value must be from -99999 to 99999" ValidationGroup="ProductPictures"
                    MinimumValue="-99999" MaximumValue="99999"></nopCommerce:NumericTextBox>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Update" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="btnUpdate" runat="server" CssClass="adminButton" Text="Update" ValidationGroup="ProductPictures"
                    CommandName="UpdateProductPicture" ToolTip="Update this picture" />
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Delete" HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="15%"
            ItemStyle-HorizontalAlign="Center">
            <ItemTemplate>
                <asp:Button ID="btnDeletePicture" runat="server" CssClass="adminButton" Text="Delete"
                    CausesValidation="false" CommandName="Delete" ToolTip="Delete this picture" />
            </ItemTemplate>
        </asp:TemplateField>
    </Columns>
</asp:GridView>
<p>
    <strong>Add a new picture </strong>
</p>
<table class="adminContent">
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblSelectPicture" Text="Select picture:"
                ToolTip="Choose a picture to upload. If the picture size exceeds your stores max image size setting, it will be automatically resized. You can manage resizing from Configuration : Global Settings"
                ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <asp:FileUpload class="text" ID="fuProductPicture" CssClass="adminInput" runat="server"
                ToolTip="Choose a file to upload" />
        </td>
    </tr>
    <tr>
        <td class="adminTitle">
            <nopCommerce:ToolTipLabel runat="server" ID="lblProductDisplayOrder" Text="Display order:"
                ToolTip="Display order of the picture. 1 represents the top of the list." ToolTipImage="~/Administration/Common/ico-help.gif" />
        </td>
        <td class="adminData">
            <nopCommerce:NumericTextBox runat="server" CssClass="adminInput" ID="txtProductPictureDisplayOrder"
                Value="1" RequiredErrorMessage="Display order is required" RangeErrorMessage="The value must be from -99999 to 99999"
                MinimumValue="-99999" MaximumValue="99999" ValidationGroup="UploadNewProductPicture">
            </nopCommerce:NumericTextBox>
        </td>
    </tr>
    <tr>
        <td colspan="2" align="left">
            <asp:Button runat="server" ID="btnUploadProductPicture" CssClass="adminButton" Text="Upload"
                ValidationGroup="UploadNewProductPicture" OnClick="btnUploadProductPicture_Click"
                ToolTip="Upload the picture" />
        </td>
    </tr>
</table>
